import { Controller, Post, UploadedFile } from '@nestjs/common';

import { uploadFilter } from 'src/cu-dec/cu-dec';
import { fileTypeCheck } from 'src/utils/fileTypeCheck';

@Controller('files')
export class FileController {
  @Post('img')
  @uploadFilter('file', {
    fileFilter: fileTypeCheck('image'),
  })
  img(@UploadedFile() file: Express.Multer.File) {
    return file;
  }
}
